Skip to content

Commit

Permalink
Change default config to use pathPrefix: "/" and then use `--pathpref…
Browse files Browse the repository at this point in the history
…ix="/eleventy-base-blog/` for GitHub deploy command. Requires Eleventy v0.2.11
  • Loading branch information
zachleat committed Jan 26, 2018
1 parent c81bebd commit 6dcc240
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ module.exports = function(eleventyConfig) {
"css"
],

// if your site lives in a subdirectory, change this
pathPrefix: "/eleventy-base-blog/",
// If your site lives in a different subdirectory, change this.
// Leading or trailing slashes are all normalized away, so don’t worry about it.
// If you don’t have a subdirectory, use "" or "/" (they do the same thing)
// This is only used for URLs (it does not affect your file structure)
pathPrefix: "/",

markdownTemplateEngine: "liquid",
htmlTemplateEngine: "njk",
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node_js:
- 8
before_script:
- npm install @11ty/eleventy -g
script: eleventy
script: eleventy --pathprefix="/eleventy-base-blog/"
deploy:
local-dir: _site
provider: pages
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ DEBUG=* npx eleventy
* `_includes/layouts/base.njk`: the top level HTML structure
* `_includes/layouts/home.njk`: the home page template (wrapped into `base.njk`)
* `_includes/layouts/post.njk`: the blog post template (wrapped into `base.njk`)
* `_includes/postlist.njk` is a Nunjucks macro and is a reusable component used to display a list of all the posts. `index.njk` has an example of how to use it.
* `_includes/postlist.njk` is a Nunjucks include and is a reusable component used to display a list of all the posts. `index.njk` has an example of how to use it.
5 changes: 4 additions & 1 deletion css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,8 @@ pre {
/* Warning */
.warning {
background-color: #ffc;
padding: 0.375em 0.625em; /* 6px 10px /16 */
padding: 1em 0.625em; /* 16px 10px /16 */
}
.warning ol:only-child {
margin: 0;
}
6 changes: 5 additions & 1 deletion index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ navtitle: Home
---

<div class="warning">
Now edit the <code>_data/metadata.json</code> with your blog’s information—and delete this message from <code>index.njk</code>.
<ol>
<li>Edit the <code>_data/metadata.json</code> with your blog’s information.</li>
<li>(Optional) Edit <code>.eleventy.js</code> with your configuration preferences.</li>
<li>Delete this message from <code>index.njk</code>.</li>
</ol>
</div>

{% set postslist = collections.posts %}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"homepage": "https://github.com/11ty/eleventy-base-blog#readme",
"devDependencies": {
"@11ty/eleventy": ">=0.2.10",
"@11ty/eleventy": ">=0.2.11",
"luxon": "^0.3.1",
"prismjs": "^1.10.0"
}
Expand Down

0 comments on commit 6dcc240

Please sign in to comment.