Browse Source

Change default config to use pathPrefix: "/" and then use `--pathprefix="/eleventy-base-blog/` for GitHub deploy command. Requires Eleventy v0.2.11

upstream
Zach Leatherman 4 years ago
parent
commit
6dcc240219
6 changed files with 17 additions and 7 deletions
  1. +5
    -2
      .eleventy.js
  2. +1
    -1
      .travis.yml
  3. +1
    -1
      README.md
  4. +4
    -1
      css/index.css
  5. +5
    -1
      index.njk
  6. +1
    -1
      package.json

+ 5
- 2
.eleventy.js View File

@ -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",


+ 1
- 1
.travis.yml View File

@ -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


+ 1
- 1
README.md View File

@ -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.

+ 4
- 1
css/index.css View File

@ -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;
}

+ 5
- 1
index.njk View File

@ -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 %}


+ 1
- 1
package.json View File

@ -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"
}


Loading…
Cancel
Save