Skip to content

Commit

Permalink
Changed:
Browse files Browse the repository at this point in the history
1. Removed site.url from config and made all links depend on site.baseurl instead.
  • Loading branch information
tocttou committed Jan 6, 2018
1 parent 97586e2 commit fdfc7b0
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion 404.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ layout: default
title: 404
---

This page does not exist. [Go back](/).
This page does not exist. [Go back]({{ "/" | prepend: site.baseurl | replace: '//', '/' }}).
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ If you want to see the changes before pushing the blog to Github, do a local bui
1. [`gem install jekyll`](https://jekyllrb.com/docs/installation/#install-with-rubygems)
2. `gem install jekyll-seo-tag`
3. (`cd` to the blog directory, then:) `jekyll serve --watch --port 8000`
4. Go to `http://0.0.0.0:8000/` in your web browser.

*Note: In case you have set a `baseurl` different than `/` in `_config.yml`, go to `http://0.0.0.0:8000/BASEURL/` instead.*

### Local build using docker

Expand All @@ -36,7 +39,9 @@ docker run --rm -p 8000:8000 \
jekyll serve --watch --port 8000
```

Replace `LOCATION_OF_YOUR_JEKYLL_BLOG` with the full path of your blog repository. Visit `http://localhost:8000` to access the blog.
Replace `LOCATION_OF_YOUR_JEKYLL_BLOG` with the full path of your blog repository. Visit `http://localhost:8000/` to access the blog.

*Note: In case you have set a `baseurl` different than `/` in `_config.yml`, go to `http://0.0.0.0:8000/BASEURL/` instead.*

## Customizing

Expand All @@ -47,17 +52,20 @@ Edit the `_config.yml` file and set the following variables:
```yml
title: [The title of your blog]
description: [A short description of your blog's purpose]
url: [Canonical URL for this blog]
author:
name: [Your name]
email: [Your email address]
url: [URL of your website]

baseurl: [The base url for this blog.]

paginate: [Number of posts in one paginated section (default: 3)]
owner: [Your name]
year: [Current Year]
```
*Note: All links in the site are prepended with `baseurl`. Default `baseurl` is `/`. Any other baseurl can be setup like `baseurl: /hacker-blog`, which makes the site available at `http://domain.name/hacker-blog`.*

Additionally, you may choose to set the following optional variables:

```yml
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
title: Hacker-Blog
description: "A Jekyll Blog Theme For Hackers"
url: "https://ashishchaudhary.in/hacker-blog"
author:
name: "SomeHacker"
email: "[email protected]"
url: "https://ashishchaudhary.in/hacker-blog"

baseurl: /

source: .
destination: ./_site
permalink: /:title
Expand Down
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<title>{%if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>

<link rel="stylesheet" href="{%if site.url %}{{ "/css/main.css" | prepend: site.url }}{% else %}{{ "/css/main.css" }}{% endif %}">
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl | replace: '//', '/' }}">

<link href="/atom.xml" type="application/atom+xml" rel="alternate" title="ATOM Feed" /> {% seo %}
</head>
2 changes: 1 addition & 1 deletion _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<header>
<div>
<a href="{%if site.url %}{{ site.url }}{% else %}{{ "/" }}{% endif %}">
<a href="{{ "/" | prepend: site.baseurl | replace: '//', '/' }}">
{% assign owner_first_name = site.owner | split: " " %}
<h1>{{ owner_first_name[0] | downcase }}@home:~$</h1>
</a>
Expand Down
6 changes: 3 additions & 3 deletions _includes/links.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a href="{%if site.url %}{{ "/archive" | prepend: site.url }}{% else %}{{ "/archive" }}{% endif %}"><h2 class="header-link">Archive</h2></a>
<a href="{%if site.url %}{{ "/about" | prepend: site.url }}{% else %}{{ "/about" }}{% endif %}"><h2 class="header-link">About</h2></a>
<a href="{%if site.url %}{{ "/atom.xml" | prepend: site.url }}{% else %}{{ "/atom.xml" }}{% endif %}"><h2 class="header-link">RSS</h3></a>
<a href="{{ "/archive" | prepend: site.baseurl | replace: '//', '/' }}"><h2 class="header-link">Archive</h2></a>
<a href="{{ "/about" | prepend: site.baseurl | replace: '//', '/' }}"><h2 class="header-link">About</h2></a>
<a href="{{ "/atom.xml" | prepend: site.baseurl | replace: '//', '/' }}"><h2 class="header-link">RSS</h2></a>
6 changes: 5 additions & 1 deletion archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ title: Archive
<ul>
{% endif %}
{% endunless %}
<li><time>{{ post.date | date:"%d %b" }} - </time><a href="{{ post.url }}">{{ post.title }}</a></li>
<li><time>{{ post.date | date:"%d %b" }} - </time>
<a href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">
{{ post.title }}
</a>
</li>
{% endfor %}
</ul>

Expand Down
8 changes: 4 additions & 4 deletions atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ layout: null
<feed xmlns="http://www.w3.org/2005/Atom">

<title>{{ site.title }}</title>
<link href="{{ site.url }}/atom.xml" rel="self"/>
<id>{{ site.url }}</id>
<link href="{{ "/atom.xml" | prepend: site.baseurl | replace: '//', '/' }}" rel="self"/>
<id>{{ site.baseurl }}</id>
<updated>{{ site.time | date_to_xmlschema }}</updated>
<author>
<name>{{ site.author.name }}</name>
Expand All @@ -19,8 +19,8 @@ layout: null

<entry>
<title>{{ post.title }}</title>
<link href="{{ site.url }}{{ post.url }}"/>
<id>{{ site.url }}{{ post.id }}</id>
<link href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}"/>
<id>{{ post.id | prepend: site.baseurl | replace: '//', '/' }}</id>
<updated>{{ post.date | date_to_xmlschema }}</updated>
<content type="html">{{ post.content | xml_escape | truncatewords:50 }}</content>
</entry>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ul>
{% for post in paginator.posts %}
<li>
<h2><a href="{% if site.baseurl == "/" %}{{ post.url }}{% else %}{{ post.url | prepend: site.baseurl }}{% endif %}">{{ post.title }}</a></h2>
<h2><a href="{{ post.url | prepend: site.baseurl | replace: '//', '/' }}">{{ post.title }}</a></h2>
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date_to_string }}</time>
<p>{{ post.content | strip_html | truncatewords:50 }}</p>
</li>
Expand Down

1 comment on commit fdfc7b0

@ambermatn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a world class act hacker?I was in some really embarrassing cyber issues which led me to meeting some fake hackers as well but my zeal to solve my issue eventually paid off when I met a friend who introduced me to his hacker friend,his work rate,professionalism and discretion is top class..He hacks from destroying data and evidence against you,changing school and university grades,hacking into your cheating spouse phone to someone who is trying to blackmail you and etc.His services are top class! You can drop him a text [email protected] He’s kinda picky though so make mention of the Path referred you…Goodluck!

Please sign in to comment.