[gimp-web/gimp-web-static] Added link to mockup3.png on meta. More explanation on WTF



commit ff19cd8a5701152a9d9f3da85319a03f58d90faf
Author: Pat David <patdavid gmail com>
Date:   Fri Aug 7 16:32:08 2015 -0500

    Added link to mockup3.png on meta.  More explanation on WTF

 content/about/meta/index.md       |    2 +-
 content/about/meta/wtf-pelican.md |   77 +++++++++++++++++++++++++++++++++++++
 2 files changed, 78 insertions(+), 1 deletions(-)
---
diff --git a/content/about/meta/index.md b/content/about/meta/index.md
index 3b148ee..4689d2b 100644
--- a/content/about/meta/index.md
+++ b/content/about/meta/index.md
@@ -10,7 +10,7 @@ I (Pat David) am creating this page to keep notes and information for building/m
 
 The work I am doing here is based on a couple of suggestions over the past year to refresh the design of WGO.
 In particular, I had created a brief mockup to show and have been using that as a sort of visual guide for 
approaching the main page.
-You can view that [mockup .PNG here](/images/mockup3.png).
+You can view that [mockup .PNG here](/images/mockup3.png) (~1.8MB).
 
 <figure>
 <img src="{attach}fluffle-puff.jpg" alt='Fluffle Puff'>
diff --git a/content/about/meta/wtf-pelican.md b/content/about/meta/wtf-pelican.md
index 29fcb4e..2115434 100644
--- a/content/about/meta/wtf-pelican.md
+++ b/content/about/meta/wtf-pelican.md
@@ -15,3 +15,80 @@ I had two things in mind,
  In particular this is handy for tutorials, where the tutorial files and all of its assets (images, scripts) 
are all contained in the same folder.
 2. Each folder would represent a base url path on its own.  
  This means that for an **About** page, the folder would be `/content/about/`, and the page for it would be 
`/content/about/index.html`.
+
+For a given input folder, and file, such as:
+
+`/content/about/`  
+`/content/about/index.md`
+
+There would be a generated url/file as:
+
+`gimp.org/about/`  
+`gimp.org/about/index.html`
+
+This way, nested folder structures in the `content` folder would be mirrored on the final site URL paths.
+
+The addition of a second file under the same directory:
+
+`/content/about/ancient_history.md`
+
+Would properly render as:
+
+`gimp.org/about/ancient_history.html`
+
+
+
+### Nested Folders
+
+This works well for extra nested folders, such as the [Tutorials](/tutorials/) section of the site.
+The old structure had a `/tutorials/` page that then listed all of the tutorial directories under it:
+
+```
+/tutorials/
+/tutorials/GIMP_Quickies/
+/tutorials/Layer_Masks/
+```
+
+
+## What Did you do Ray?
+<figure>
+<img src="https://upload.wikimedia.org/wikipedia/en/d/d8/Stay-puft-marshmallow-man.jpg"; alt="Stay Puft" 
title='Ray, when someone asks you if you&rsquo;re a god, you say "YES"!' />
+<figcaption>
+*It's the Stay Puft Marshmallow Man...*
+</figcaption>
+</figure>
+
+The problem is, Pelican doesn't want to do this naturally.
+There were a couple of plugins that produced similar type of output but wasn't *quite* the same thing.
+
+The closest thing I could find was a plugin on the plugin repository called [*Page 
Hierarchy*](https://github.com/akhayyat/pelican-page-hierarchy).
+
+This plugin was close, but was missing a few things that I had to add.
+
+1. OS-agnostic file system separators.   
+This was a simple fix that was already pushed to the plug-in author.
+
+2. The metadata override was a little more problematic.  
+Basically, the plug-in was overriding the *slug* object with a custom one for the nesting based on the 
filesystem.
+All I did was continue that line of thought and brute-forced the index.md under each directory to the right 
slug.
+
+        :::python
+        # PLD: this is my doing, sorry...
+        # ok, if path is empty, use page.slug
+        # if path is not empty, use path
+        # still need to test if lang works properly after this
+        if path:
+            print( "got path" )
+            print( path )
+            metadata['slug'] = path
+        else:
+            print( "path empty!" )
+            print( page.slug )
+            metadata['slug'] = page.slug
+
+        if metadata['filename'] != 'index.html':
+            setattr(page, 'override_url', metadata['slug'] +'/'+ metadata['filename'] )
+
+So far, so good?  Nothing seems to explode, so I'm taking that as a positive sign.
+The only thing I haven't checked yet (and that I think will be awesome) is the ability to provide translated 
versions of all pages.
+I may have to wrangle someone to translate a page for me to test with (or just use gibberish to test, I 
guess).


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]