diff --git a/README.md b/README.md index 8ffd179..b0f1ebd 100644 --- a/README.md +++ b/README.md @@ -176,10 +176,13 @@ If you're not sure what the difference is, you can probably safely ignore this s If you want to use this theme to host a website that will be available at `https://YOURUSERNAME.github.io`, then you do not need to read this section. That is called a User Page, you can only have one User Page in your GitHub account, and it is what you get by default when forking this project. -If you want to use this theme to create a website for a particular repository, it will be available at `https://YOURUSERNAME.github.io/REPONAME`, and that is called a [Project Page](https://help.github.com/articles/user-organization-and-project-pages/). You can have a Project Page for each repository you have on GitHub. There are two important things to note when creating a project page: +If you want to use this theme to create a website for a particular repository, it will be available at `https://YOURUSERNAME.github.io/REPONAME`, and that is called a [Project Page](https://help.github.com/articles/user-organization-and-project-pages/). You can have a Project Page for each repository you have on GitHub. -1. In the configuration file (`_config.yml`), you should set `baseurl` to be `/projectname` instead of `""`. -2. Project Pages are served from a branch named `gh-pages`, and you should be generating all the website content on that branch. When you fork Beautiful Jekyll, you'll already have a `gh-pages` branch but you should delete it and generate it again from the `master` branch. The reason is that the `gh-pages` branch in its current form does not have the updated code of Beautiful Jekyll, so you need to create that branch from the `master` branch (which is where all my new features and work go into). +There are two important point to note, assuming your project website will be served under `gh-pages` branch (check [Github Page official documentation](https://help.github.com/en/articles/configuring-a-publishing-source-for-github-pages) for usable source): + +1. When copying files from this repository, **only copy from `master` branch** of this theme, which is where all my new features and work go into. After copying stuff to `gh-pages` branch under your project... + +2. Adjust all configurations and templates according to your taste, but in particular, there is no need to set `url` and `baseurl` inside `_config.yml`. Github will fill in the variables for you. Just push the changes and enjoy! ## Showcased users (success stories!) @@ -280,6 +283,17 @@ The default style of Beautiful Jekyll is to feature the blog feed on the front p Unfortunately, this is a no-answer! There isn't a one-size-fits-all solution to this, because every person will view your site on a different browser with different dimensions. Some browsers will have very wide aspect ratio, some will be narrower, some will be vertical (such as phones), different phones have different screens, etc. The image will always be centered, so the only tip I can give is that you should make sure the important part of the image is in the middle so that it'll always show. Other than that, every browser will show a different clipping of the image. +#### After recent update some links in my project page appear to be broken! + +Since late June 2019, some URL related setting are adjusted to be in line with how Jekyll uses them officially. Project page absolute links might appear to be broken if you haven't propagated all necessary changes to your local templates, or you have created additional templates making use of old settings. If links contain duplicated project path component, this is most likely the cause. In summary: + +|   | Old behavior | New behavior | +| --- | --- | --- | +| `url` setting | `https://user.github.io/project` | (unset, GitHub auto detect) | +| `baseurl` setting | `/project` | (unset, GitHub auto detect) | +| Absolute link construction | `{{ site.url }}/your/path` | `{{ '/your/path' \| absolute_url }}` | +| Relative link construction | `{{ site.baseurl }}/your/path` | `{{ '/your/path' \| relative_url }}` | + ## Credits This template was not made entirely from scratch. I would like to give special thanks to: diff --git a/_config.yml b/_config.yml index d1386b1..1b560ac 100644 --- a/_config.yml +++ b/_config.yml @@ -1,23 +1,20 @@ # --- General options --- # -# url is the full website URL -# baseurl is the website's URL without the hostname - -# If you are building a simple GitHub user page (https://username.github.io) then use these settings: -url: "https://username.github.io" -baseurl: "" - -# If you are building a GitHub project page then use these settings: -#url: "http://username.github.io/projectname" -#baseurl: "/projectname" - -# Of course don't forget to change the username and projectname to YOUR username and project - # Name of website title: My website # Short description of your site -description: A virtual proof that name is awesome! +description: A virtual proof that I'm awesome + +# --- Local development options --- +# If your website is hosted locally rather than on GitHub, then you need to uncomment the next two parameters to set the url and baseurl +# *** If you're not sure what this mean, then leave this section as it is. Only modify the url and baseurl if you know what you're doing!*** + +# url is the the website domain URL without a trailing slash +#url: "https://example.com" + +# baseurl should be an empty string +#baseurl: "" # --- Navigation bar options --- # @@ -27,7 +24,6 @@ navbar-links: Resources: - Beautiful Jekyll: "http://deanattali.com/beautiful-jekyll/" - Learn markdown: "http://www.markdowntutorial.com/" - - GitHub Pages: "https://pages.github.com/" Author's home: "http://deanattali.com" # Image to show in the navigation bar - image must be a square (width = height) diff --git a/_includes/fb-comment.html b/_includes/fb-comment.html index 8b47a2b..f358061 100644 --- a/_includes/fb-comment.html +++ b/_includes/fb-comment.html @@ -8,7 +8,7 @@ js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12&appId={{ site.fb_comment_id }}&autoLogAppEvents=1'; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); -
+
{%- endif -%} diff --git a/_includes/footer-minimal.html b/_includes/footer-minimal.html index d8d3b41..f3cce3a 100644 --- a/_includes/footer-minimal.html +++ b/_includes/footer-minimal.html @@ -7,10 +7,10 @@ {% else %} {{ site.time | date: '%Y' }} {% endif %} - + {% if site.url-pretty %}   •   - {{ site.url-pretty }} - {% endif %} + {{ site.url-pretty }} + {% endif %} \ No newline at end of file diff --git a/_includes/footer.html b/_includes/footer.html index b942456..bff9d58 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -30,7 +30,7 @@ {% if site.url-pretty %}  •  - {{ site.url-pretty }} + {{ site.url-pretty }} {% endif %} {% if site.matomo %} diff --git a/_includes/head.html b/_includes/head.html index ab8e025..0c298c0 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -11,7 +11,7 @@ {% endif %} - + {% include gtag.html %} {% include gtm_head.html %} @@ -78,17 +78,17 @@ {% if page.id %} - - + + {% else %} - - + + {% endif %} {% if page.share-img %} {% elsif site.avatar %} - + {% endif %} @@ -116,7 +116,7 @@ {% if page.share-img %} {% elsif site.avatar %} - + {% endif %} {% if site.matomo %} diff --git a/_includes/nav.html b/_includes/nav.html index 42dc909..a0d26b8 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -8,9 +8,9 @@ {% if site.title-img %} - + {% else %} - {{ site.title }} + {{ site.title }} {% endif %} @@ -40,7 +40,7 @@ {% if page.image and (layout.show-avatar or page.show-avatar) %}
- +
@@ -48,7 +48,7 @@ {% elsif site.avatar and (layout.show-avatar or page.show-avatar) %}
diff --git a/_includes/social-share.html b/_includes/social-share.html index c591ab5..6cfe176 100644 --- a/_includes/social-share.html +++ b/_includes/social-share.html @@ -12,7 +12,7 @@ {% if site.share-links-active.twitter %} - Twitter @@ -21,7 +21,7 @@ {% if site.share-links-active.facebook %} - Facebook @@ -30,7 +30,7 @@ {% if site.share-links-active.linkedin %} - LinkedIn diff --git a/feed.xml b/feed.xml index 4bebae6..c5b5664 100644 --- a/feed.xml +++ b/feed.xml @@ -6,8 +6,8 @@ layout: null {{ site.title | xml_escape }} {{ site.description | xml_escape }} - {{ site.url }} - + {{ '' | absolute_url }} + {% for post in site.posts limit:20 %} {{ post.title | xml_escape }} @@ -16,8 +16,8 @@ layout: null {{ post.content | strip_html | xml_escape | truncatewords: 50 }} {{ post.date | date: "%a, %d %b %Y %H:%M:%S %z" }} - {{ site.url }}{{ post.url }} - {{ site.url }}{{ post.url }} + {{ post.url | absolute_url }} + {{ post.url | absolute_url }} {% endfor %} diff --git a/tags.html b/tags.html index 809486c..1f40c71 100644 --- a/tags.html +++ b/tags.html @@ -23,7 +23,7 @@ title: 'Tag Index'
{%- for post in site.tags[tag] -%}
- {{- post.title -}} + {{- post.title -}}