Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- New property HUGO_BUNDLE, used to specify the bundle URL. - If the HUGO_BUNDLE is non-nil, it is auto-appended to the full page URL. - Attachment rewrite now "does the right thing".. copied the attachments to the bundle dir instead of to the static/ dir. - Added a page bundle example, with images, "resources" front-matter. - Updated the test site "single.html" template with debug info for .Resources. Fixes #111
- Loading branch information
1 parent
57a28d1
commit 5512bad
Showing
8 changed files
with
175 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+++ | ||
title = "Bundled page bar" | ||
tags = ["page-bundles"] | ||
draft = false | ||
+++ | ||
|
||
"Bar" page in _Page Bundle A_. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+++ | ||
title = "Bundled page foo" | ||
tags = ["page-bundles"] | ||
draft = false | ||
+++ | ||
|
||
"Foo" page in _Page Bundle A_. |
Binary file added
BIN
+7.33 KB
test/site/content/bundles/page-bundle-a/images/copy-of-unicorn-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
+++ | ||
title = "Page A" | ||
tags = ["page-bundles"] | ||
draft = false | ||
[[resources]] | ||
src = "images/copy-of-*.png" | ||
title = "First copy of Org mode logo" | ||
[[resources]] | ||
src = "copy-2-*.png" | ||
title = "Second copy of Org mode logo" | ||
+++ | ||
|
||
Index page of _Page Bundle A_. | ||
|
||
|
||
## Link to images not in the current directory {#link-to-images-not-in-the-current-directory} | ||
|
||
|
||
### Source path contains `/static/` {#source-path-contains-static} | ||
|
||
{{<figure src="images/copy-of-unicorn-logo.png">}} | ||
|
||
If you link to files not in the **current directory**, ensure that the | ||
path contains `/static/` if you would like to preserve the directory | ||
structure. | ||
|
||
Example translations between the `static`-containing image paths to | ||
the copied location inside the bundle: | ||
|
||
| Outside `static` | Copied-to location inside BUNDLE | Explanation | | ||
|----------------------------------|---------------------------------------------------------------|------------------------------------------------------------------------------------------------------------| | ||
| `~/temp/static/images/foo.png` | `<HUGO_BASE_DIR>/content/<SECTION>/<BUNDLE>/images/foo.png` | If the **outside** path has `/static/` in it, the directory structure after that is preserved when copied. | | ||
| `~/temp/static/img/foo.png` | `<HUGO_BASE_DIR>/content/<SECTION>/<BUNDLE>/img/foo.png` | (same as above) | | ||
| `~/temp/static/foo.png` | `<HUGO_BASE_DIR>/content/<SECTION>/<BUNDLE>/foo.png` | (same as above) | | ||
| `~/temp/static/articles/zoo.pdf` | `<HUGO_BASE_DIR>/content/<SECTION>/<BUNDLE>/articles/zoo.pdf` | (same as above) | | ||
|
||
|
||
### Source path does not contain `/static/` {#source-path-does-not-contain-static} | ||
|
||
{{<figure src="copy-2-of-unicorn-logo.png">}} | ||
|
||
| Outside `static` | Copied-to location inside BUNDLE | Explanation | | ||
|--------------------------|------------------------------------------------------|--------------------------------------------------------------------------------------------------------| | ||
| `~/temp/bar/baz/foo.png` | `<HUGO_BASE_DIR>/content/<SECTION>/<BUNDLE>/foo.png` | Here, as the **outside** path does not have `/static/`, the file is copied directly to the BUNDLE dir. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters