### Blog Post Markdown Example Source: https://context7.com/multiverse/multiverse.github.com/llms.txt This Markdown example demonstrates the structure of a blog post, including front matter for metadata and the main content written in Markdown. The front matter specifies the layout, category, header, and author, which are then used by the post layout template. The content includes paragraphs, links, and headings. ```markdown --- layout: post category : news header: FernFerret is Back! author: fernferret --- Hello all! It's been a while, but I'm finally back in action. I needed a little break to venture out into the world. I'll be working through all [250ish issues](https://github.com/multiverse/Multiverse-Core/issues) in the tracker in Core alone. #### re: Lack of Communication This is because a lot of the developers have other things going on right now. I can say a fair number of us have full time jobs... Cheers, --FF ``` -------------------------------- ### Set up Git Repository and Remote for Collaboration Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2011-09-21-credit-where-credits-due.md This snippet demonstrates the initial steps to prepare a local Git repository for collaboration. It involves cloning the central repository, navigating into it, and adding a remote repository for a collaborator. This is essential for fetching and merging changes from external contributors. ```bash git clone git@github.com:Multiverse/Multiverse-Portals.git cd Multiverse-Portals git remote add vibroaxe https://github.com/VibroAxe/Multiverse-Portals.git ``` -------------------------------- ### Heroku Deployment Configuration (Procfile) Source: https://context7.com/multiverse/multiverse.github.com/llms.txt Procfile for deploying the Jekyll site on Heroku. Configures the web server process using the `jekyll` command with specific flags for server mode, port, and disabling LSI and safe mode. ```bash # Procfile web: jekyll --server $PORT --no-lsi --safe --pygments # Run locally with: foreman start ``` -------------------------------- ### Jekyll Front Matter and Templating (Liquid) Source: https://github.com/multiverse/multiverse.github.com/blob/master/_layouts/post.html This snippet demonstrates Jekyll's front matter and Liquid templating syntax. It defines page metadata like header, author, and date, and uses Liquid tags to conditionally display content and navigation links. This is typical for structuring content on GitHub Pages. ```liquid --- layout: default --- {{ page.header }}{%if page.author %} by [{{page.author}}]({{ "http://www.github.com/" + page.author }}){% endif %} ============================================================================================================= #### {{ page.date | date: "%B %e, %Y" }} * * * {{ content }} * * * {% if page.previous %} {% if page.categories == page.previous.categories %}* [← {{ page.previous.title }}]({{ page.previous.url }}) {% endif %} {% endif %} {% if page.next %} {% if page.categories == page.next.categories %}* [{{ page.next.title }} →]({{ page.next.url }}) {% endif %} {% endif %} ``` -------------------------------- ### Pagination Controls - Liquid Templating Source: https://github.com/multiverse/multiverse.github.com/blob/master/_includes/helpers/paginate.html This snippet generates pagination controls using Liquid templating. It provides links to 'Older' posts if a next page exists and 'Newer' posts if a previous page exists. The 'Newer' link correctly points to the root path for the first page. ```liquid {% if paginator.next_page %}* [← Older](/page{{paginator.next_page}}) {% endif %} {% if paginator.previous_page %}* {% if paginator.previous_page == 1 %} [Newer →](/) {% else %} [Newer →](/page{{paginator.previous_page}}) {% endif %} {% endif %} ``` -------------------------------- ### Iterate and Display Blog Posts - Liquid Templating Source: https://github.com/multiverse/multiverse.github.com/blob/master/_includes/helpers/paginate.html This snippet iterates through a collection of posts using Liquid templating. It displays the post title, URL, date, and author if available. The content is truncated based on a 'limit' attribute or a default value. It also includes a 'Read More' link if the content is truncated. ```liquid {% for post in paginator.posts %} ### [{{ post.title }}]({{ post.url }}) {{ post.date | date: "%B %e, %Y" }}{%if post.author %} by [{{ post.author }}](http://www.github.com/{{ post.author }}){% endif %} {% if post.limit %} {{ post.content | truncatewords:post.limit }} {% else %} {{ post.content | truncatewords:150 }} {% endif %} {% capture text %}{{ post.content | strip_html }}{% endcapture %} {% capture truncated_text %}{{ text | truncatewords: 150 }}{% endcapture %} {% if text != truncated_text %} [Read More]({{ post.url }}) {% endif %} {% unless forloop.last %} * * * {% endunless %} {% endfor %} ``` -------------------------------- ### Paginated Post Display (_includes/helpers/paginate.html) Source: https://context7.com/multiverse/multiverse.github.com/llms.txt Liquid template include for displaying paginated blog posts. It iterates through `paginator.posts`, displays the title, date, author (if available), and a truncated content excerpt. Includes navigation links for older and newer posts. ```liquid {% comment %}_includes/helpers/paginate.html{% endcomment %} {% for post in paginator.posts %}

{{ post.title }} {{ post.date | date: "%B %e, %Y" }}{%if post.author %} by {{ post.author }}{% endif %}

{% if post.limit %} {{ post.content | truncatewords:post.limit }} {% else %} {{ post.content | truncatewords:150 }} {% endif %} {% capture text %}{{ post.content | strip_html }}{% endcapture %} {% capture truncated_text %}{{ text | truncatewords: 150 }}{% endcapture %} {% if text != truncated_text %}

Read More

{% endif %}

{% unless forloop.last %}
{% endunless %} {% endfor %} ``` -------------------------------- ### Blog Post HTML Layout (_layouts/post.html) Source: https://context7.com/multiverse/multiverse.github.com/llms.txt This HTML template is designed for individual blog posts. It inherits from the default layout, displays the post's header, author, and date, and includes integration for Disqus comments. It also implements navigation for previous and next posts within the same category. ```html --- layout: default ---

{{ page.header }}{%if page.author%} by {{page.author}}{% endif %}

{{ page.date | date: "%B %e, %Y" }}


{{ content }}
``` -------------------------------- ### Jekyll Configuration (_config.yml) Source: https://context7.com/multiverse/multiverse.github.com/llms.txt Configuration settings for the Jekyll static site generator. Defines build behavior, site structure, pagination, and navigation links. Excludes specific files from the build process. ```yaml # _config.yml exclude: ["\.rvmrc", "\.rbenv-version", "\.gitignore", "README.md", "Rakefile", "Gemfile", "Gemfile.lock", "Procfile", "vendor", "CNAME"] permalink: "/:categories/:title.html" auto: true lsi: false pygments: true safe: true paginate: 3 navigation: - Home: "/" - News: "/news.html" - About: "/about.html" - Contribute: "/contributing.html" - Download: "/download.html" ``` -------------------------------- ### Configure Static Navigation (YAML) Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2012-10-20-taming-jekyll.md This snippet shows how to define a static navigation structure for a Jekyll site using YAML. It creates a list of navigation links, each with a display name and its corresponding URL. This configuration is then used by Liquid templates to render the navigation bar. ```yaml navigation: - Home: / - News: /news.html - About: /about.html - Contribute: /contributing.html - Download: /download.html ``` -------------------------------- ### Dynamic Navigation Menu (_includes/helpers/static_nav.html) Source: https://context7.com/multiverse/multiverse.github.com/llms.txt Liquid template include for generating a dynamic navigation menu. It iterates through `site.navigation` and applies an 'active' class to the current page's link. It also handles active states for the 'Home' and 'News' pages specifically. ```liquid {% comment %}_includes/helpers/static_nav.html{% endcomment %} {% for link_hash in site.navigation %} {% for link in link_hash %} {% if page.url == link[1] %}
  • {{ link[0] }}
  • {% elsif page.url contains 'index.html' %} {% if link[0] == "Home" %}
  • {{ link[0] }}
  • {% else %}
  • {{ link[0] }}
  • {% endif %} {% elsif page.url contains 'news/' %} {% if link[0] == "News" %}
  • {{ link[0] }}
  • {% else %}
  • {{ link[0] }}
  • {% endif %} {% else %}
  • {{ link[0] }}
  • {% endif %} {% endfor %} {% endfor %} ``` -------------------------------- ### Jinja Navigation Highlighting for Active URLs Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2012-10-20-taming-jekyll.md This Jinja template code dynamically generates navigation links, highlighting the active link based on the current page URL. It handles specific cases for 'Home' and 'News' sections, ensuring correct highlighting for root URLs and specific subdirectories. The code iterates through a navigation structure defined in `site.navigation`. ```jinja {% literal %} {% elsif page.url contains 'news/' %} {% for link_hash in site.navigation %} {% for link in link_hash %} {% if page.url == link[1] %}
  • {{ link[0] }}
  • {% elsif page.url contains 'index.html' %} {% if link[0] == "Home" %}
  • {{ link[0] }}
  • {% else %}
  • {{ link[0] }}
  • {% endif %} {% elsif page.url contains 'news/' %} {% if link[0] == "News" %}
  • {{ link[0] }}
  • {% else %}
  • {{ link[0] }}
  • {% endif %} {% else %}
  • {{ link[0] }}
  • {% endif %} {% endfor %} {% endfor %} {% endliteral %} ``` -------------------------------- ### Render Static Navigation Links (Jekyll/Liquid) Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2012-10-20-taming-jekyll.md This Liquid template renders a static navigation bar based on the configuration defined in the site's YAML file. It iterates through the navigation links, checking if the current page's URL matches a link's URL to apply an 'active' class for highlighting. ```jinja {% literal %} {% for link_hash in site.navigation %} {% for link in link_hash %} {% if page.url == link[1] %}
  • {{ link[0] }}
  • {% else %}
  • {{ link[0] }}
  • {% endif %} {% endfor %} {% endfor %} {% endliteral %} ``` -------------------------------- ### Highlight News Section for Blog Posts (Jekyll/Liquid) Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2012-10-20-taming-jekyll.md This Liquid code snippet extends the navigation rendering logic to highlight the 'News' link when viewing any blog post. It uses an `elsif` condition to check if the current page's URL contains 'news/' and applies the 'active' class if it does, ensuring the 'News' link remains highlighted for posts. ```jinja {% literal %} {% elsif page.url contains 'news/' %} {% if link[0] == "News" %}
  • {{ link[0] }}
  • {% else %}
  • {{ link[0] }}
  • {% endif %} {% endliteral %} ``` -------------------------------- ### Default HTML Layout (_layouts/default.html) Source: https://context7.com/multiverse/multiverse.github.com/llms.txt This HTML template defines the default page structure for the Multiverse website. It includes the head section with meta tags and stylesheets, a header, navigation bar, main content area, and a footer. It utilizes Liquid templating for dynamic content like page titles and navigation includes, and incorporates Bootstrap for styling. ```html {{ page.title | capitalize }} | Multiverse 2
    {{ content }}

    Fork me on GitHub ``` -------------------------------- ### Fetch and Checkout Collaborator's Commits Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2011-09-21-credit-where-credits-due.md This sequence of Git commands allows you to retrieve commits from a collaborator's repository and work on them locally. It involves fetching the remote repository's data and then creating a new local branch based on the collaborator's master branch. This prepares the fetched code for integration and modification. ```bash git fetch vibroaxe git checkout -b vibroaxe-cooldowns vibroaxe/master ``` -------------------------------- ### List Jekyll Pages by Category (Jekyll/Liquid) Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2012-10-20-taming-jekyll.md This snippet demonstrates how to list Jekyll pages belonging to a specific category using Liquid templating. It iterates through a list of pages and checks if their group matches the specified category. It also handles highlighting the currently active page. ```jinja {% literal %} {% for node in pages_list %} {% if group == null or group == node.group %} {% if page.url == node.url %}
  • {{ page.root }}{{ node.title | capitalize }}
  • {% else %}
  • {{ node.title | capitalize }}
  • {% endif %} {% endif %} {% endfor %} {% assign pages_list = null %} {% assign group = null %} {% endliteral %} ``` -------------------------------- ### Disqus Comment Integration Script (JavaScript) Source: https://github.com/multiverse/multiverse.github.com/blob/master/_layouts/post.html This JavaScript snippet configures and loads the Disqus comment system for a webpage. It requires a 'disqus_shortname' variable to be set with the user's Disqus forum shortname. The script dynamically creates a script element to load the Disqus embed code. ```javascript var disqus_shortname = 'multiverse2blog'; // required: replace example with your forum shortname (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); ``` -------------------------------- ### Jekyll Debug Filter Plugin (_plugins/debug.rb) Source: https://context7.com/multiverse/multiverse.github.com/llms.txt Custom Jekyll plugin that provides a Liquid filter (`debug`) for inspecting variables during development. Outputs a pretty-printed representation of the object within `
    ` tags. Requires the `pp` library.
    
    ```ruby
    # _plugins/debug.rb - Usage in any template
    # Usage in templates:
    # {{ site | debug }}
    # {{ site.posts | debug }}
    # {{ page | debug }}
    
    # Implementation
    require 'pp'
    module Jekyll
      module DebugFilter
        def debug(obj, stdout=false)
          puts obj.pretty_inspect if stdout
          "
    #{obj.class}\n#{obj.pretty_inspect}
    " end end end Liquid::Template.register_filter(Jekyll::DebugFilter) ``` -------------------------------- ### Rebase and Squash Commits for a Single Commit Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2011-09-21-credit-where-credits-due.md This Git command initiates an interactive rebase, allowing you to modify commit history. By picking the initial commit and squashing subsequent commits, you can consolidate multiple changes into a single commit. This is crucial for cleaning up history and preparing for a clean merge, especially when addressing issues like tabbing. ```bash git rebase -i master ``` -------------------------------- ### Push Combined Commit to Origin Master Source: https://github.com/multiverse/multiverse.github.com/blob/master/_posts/2011-09-21-credit-where-credits-due.md After rebasing and squashing commits to create a single, unified commit that incorporates all necessary changes and fixes, this command pushes the modified branch to the central repository. This action updates the main branch with the consolidated work, ensuring proper attribution. ```bash git push origin master ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.