Adding all unique site files.
This commit is contained in:
parent
7d1e50c4ff
commit
ca8982f82b
11 changed files with 215 additions and 108 deletions
11
config.php
11
config.php
|
@ -3,17 +3,12 @@
|
|||
/*
|
||||
// Override any of the default settings below:
|
||||
|
||||
$config['site_title'] = 'Pico'; // Site title
|
||||
$config['base_url'] = ''; // Override base URL (e.g. http://example.com)
|
||||
$config['theme'] = 'default'; // Set the theme (defaults to "default")
|
||||
$config['date_format'] = 'jS M Y'; // Set the PHP date format
|
||||
$config['twig_config'] = array( // Twig settings
|
||||
'cache' => false, // To enable Twig caching change this to CACHE_DIR
|
||||
'autoescape' => false, // Autoescape Twig vars
|
||||
'debug' => false // Enable Twig debug
|
||||
);
|
||||
$config['pages_order_by'] = 'alpha'; // Order pages by "alpha" or "date"
|
||||
$config['pages_order'] = 'asc'; // Order pages "asc" or "desc"
|
||||
$config['excerpt_length'] = 50; // The pages excerpt length (in words)
|
||||
|
||||
// To add a custom config setting:
|
||||
|
@ -21,5 +16,11 @@ $config['excerpt_length'] = 50; // The pages excerpt length (in words)
|
|||
$config['custom_setting'] = 'Hello'; // Can be accessed by {{ config.custom_setting }} in a theme
|
||||
|
||||
*/
|
||||
$config['site_title'] = 'Rewdy'; // Site title
|
||||
$config['theme'] = 'elliot'; // Set the theme (defaults to "default")
|
||||
$config['date_format'] = 'F d, Y'; // Set the PHP date format
|
||||
|
||||
$config['pages_order_by'] = 'date'; // Order pages by "alpha" or "date"
|
||||
$config['pages_order'] = 'desc'; // Order pages "asc" or "desc"
|
||||
|
||||
?>
|
|
@ -1,9 +1,8 @@
|
|||
/*
|
||||
Title: Error 404
|
||||
|
||||
Title: 4-D'oh-4!
|
||||
Robots: noindex,nofollow
|
||||
|
||||
*/
|
||||
|
||||
Error 404
|
||||
=========
|
||||
|
||||
Woops. Looks like this page doesn't exist.
|
||||
The page you're trying to access, well, doesn't exist here. Trying <a href="#home">going to the home page</a> and looking around there.
|
22
content/about.md
Normal file
22
content/about.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
|
||||
Title: About
|
||||
Description: About this site and about Rewdy.
|
||||
|
||||
*/
|
||||
|
||||
Hi. My name is Rewdy (Andrew).
|
||||
|
||||
When I was 5, my dad brought home a [Macintosh SE30](http://en.wikipedia.org/wiki/Macintosh_SE). Somehow, I figured out how to set up [HyperCard](http://en.wikipedia.org/wiki/Hypercard) "Stacks" and I started writing simple little scripts that would do things like play a series of notes or make a little guy walk across the screen.
|
||||
|
||||
I've always loved the magic that happens when you write some code and then watch something happen. It thrills me. Because of this, when my family got the Internet and I discovered you could create your own sites, I had to make one.
|
||||
|
||||
Since I was about 14, I've been using the Internet to make stuff. I studied Graphic Design in school and started to work professionally building websites in 2005.
|
||||
|
||||
I work for a company in Des Moines, Iowa making websites.
|
||||
|
||||
_Disclaimer: The views expressed on this site are solely my own._
|
||||
|
||||
---
|
||||
|
||||
Note: Every once in a while I get asked about freelance. Here is my information on that.
|
102
content/index.md
102
content/index.md
|
@ -1,100 +1,6 @@
|
|||
/*
|
||||
Title: Welcome
|
||||
Description: This description will go in the meta description tag
|
||||
|
||||
Title: Home
|
||||
Description: I make things on the Internet.
|
||||
|
||||
*/
|
||||
|
||||
## Welcome to Pico
|
||||
|
||||
Congratulations you have successfully installed [Pico](http://pico.dev7studios.com). Pico is a stupidly simple, blazing fast, flat file CMS.
|
||||
|
||||
### Creating Content
|
||||
|
||||
Pico is a flat file CMS, this means there is no administration backend and database to deal with. You simply create `.md` files in the "content"
|
||||
folder and that becomes a page. For example this file is called `index.md` and is shown as the main landing page.
|
||||
|
||||
If you created folder within the content folder (e.g. `content/sub`) and put an `index.md` inside it, you can access that folder at the URL
|
||||
`http://yousite.com/sub`. If you want another page within the sub folder, simply create a text file with the corresponding name (e.g. `content/sub/page.md`)
|
||||
and will be able to access it from the URL `http://yousite.com/sub/page`. Below we've shown some examples of content locations and their corresponing URL's:
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Physical Location</th><th>URL</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>content/index.md</td><td>/</td></tr>
|
||||
<tr><td>content/sub.md</td><td>/sub</td></tr>
|
||||
<tr><td>content/sub/index.md</td><td>/sub (same as above)</td></tr>
|
||||
<tr><td>content/sub/page.md</td><td>/sub/page</td></tr>
|
||||
<tr><td>content/a/very/long/url.md</td><td>/a/very/long/url</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
If a file cannot be found, the file `content/404.md` will be shown.
|
||||
|
||||
### Text File Markup
|
||||
|
||||
Text files are marked up using [Markdown](http://daringfireball.net/projects/markdown/syntax). They can also contain regular HTML.
|
||||
|
||||
At the top of text files you can place a block comment and specify certain attributes of the page. For example:
|
||||
|
||||
/ *
|
||||
Title: Welcome
|
||||
Description: This description will go in the meta description tag
|
||||
Author: Joe Bloggs
|
||||
Date: 2013/01/01
|
||||
Robots: noindex,nofollow
|
||||
*/
|
||||
|
||||
These values will be contained in the `{{ meta }}` variable in themes (see below).
|
||||
|
||||
There are also certain variables that you can use in your text files:
|
||||
|
||||
* <code>%base_url%</code> - The URL to your Pico site
|
||||
|
||||
### Themes
|
||||
|
||||
You can create themes for your Pico installation and in the "themes" folder. Check out the default theme for an example of a theme. Pico uses
|
||||
[Twig](http://twig.sensiolabs.org/documentation) for it's templating engine. You can select your theme by setting the `$config['theme']` variable
|
||||
in config.php to your theme folder.
|
||||
|
||||
All themes must include an `index.html` file to define the HTML structure of the theme. Below are the Twig variables that are available to use in your theme:
|
||||
|
||||
* `{{ config }}` - Conatins the values you set in config.php (e.g. `{{ config.theme }}` = "default")
|
||||
* `{{ base_dir }}` - The path to your Pico root directory
|
||||
* `{{ base_url }}` - The URL to your Pico site
|
||||
* `{{ theme_dir }}` - The path to the Pico active theme direcotry
|
||||
* `{{ theme_url }}` - The URL to the Pico active theme direcotry
|
||||
* `{{ site_title }}` - Shortcut to the site title (defined in config.php)
|
||||
* `{{ meta }}` - Contains the meta values from the current page
|
||||
* `{{ meta.title }}`
|
||||
* `{{ meta.description }}`
|
||||
* `{{ meta.author }}`
|
||||
* `{{ meta.date }}`
|
||||
* `{{ meta.date_formatted }}`
|
||||
* `{{ meta.robots }}`
|
||||
* `{{ content }}` - The content of the current page (after it has been processed through Markdown)
|
||||
* `{{ pages }}` - A collection of all the content in your site
|
||||
* `{{ page.title }}`
|
||||
* `{{ page.url }}`
|
||||
* `{{ page.author }}`
|
||||
* `{{ page.date }}`
|
||||
* `{{ page.date_formatted }}`
|
||||
* `{{ page.content }}`
|
||||
* `{{ page.excerpt }}`
|
||||
* `{{ prev_page }}` - A page object of the previous page (relative to current_page)
|
||||
* `{{ current_page }}` - A page object of the current_page
|
||||
* `{{ next_page }}` - A page object of the next page (relative to current_page)
|
||||
* `{{ is_front_page }}` - A boolean flag for the front page
|
||||
|
||||
Pages can be used like:
|
||||
|
||||
<pre><ul class="nav">
|
||||
{% for page in pages %}
|
||||
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul></pre>
|
||||
|
||||
### Config
|
||||
|
||||
You can override the default Pico settings (and add your own custom settings) by editing config.php in the root Pico directory. The config.php file
|
||||
list all of the settings and their defaults. To override a setting simply uncomment it in config.php and set your custom value.
|
||||
|
|
22
content/projects/bible-bookmarklet.md
Normal file
22
content/projects/bible-bookmarklet.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
|
||||
Title: Bible Bookmarklet
|
||||
Author: Andrew Meyer
|
||||
Description: A bookmarklet that lets you look up Bible references quickly and easily.
|
||||
Date: 20110720
|
||||
|
||||
*/
|
||||
|
||||
I am a huge fan of bookmarklets. In fact, I’m sort of passionate about them. I have a whole folder of bookmarks in my browser that is just filled with bookmarklets. Recently, I’ve come across a need for a new bookmarklet that looks up Bible references on web pages and I thought I’d try my hand at creating one of my own. So I did.
|
||||
|
||||
Here’s what it does: If you see a Bible reference that you want to look up, you can select it and click the bookmarklet and it will open up the passage on Bible Gateway. If you don’t have anything selected, it will ask you what you want to look up. Pretty simple.
|
||||
|
||||
Here it is (drag the link to your bookmarks toolbar to save):
|
||||
|
||||
<p><a href="javascript:(function(){ref=document.getSelection();if (ref!=''){window.location='http://www.biblegateway.com/quicksearch/?quicksearch='+ref;}else{ref=prompt('What do you want to look up?'); if (ref!=null && ref!=''){window.location='http://www.biblegateway.com/quicksearch/?quicksearch='+ref;}}})()">Bible Link</a> (opens in the same window/tab)</p>
|
||||
|
||||
<p><a href="javascript:(function(){ref=document.getSelection();if (ref!=''){window.open('http://www.biblegateway.com/quicksearch/?quicksearch='+ref,'','');}else{ref=prompt('What do you want to look up?'); if (ref!=null && ref!=''){window.open('http://www.biblegateway.com/quicksearch/?quicksearch='+ref,'','');}}})()">Bible Link</a> (opens in new window/tab)</p>
|
||||
|
||||
|
||||
It works only in Firefox and the webkit browsers (Chrome and Safari). Sorry IE users :(.
|
||||
For a test, you can highlight this passage and click the bookmarklet: John 3:16
|
12
content/projects/leavenotice.md
Normal file
12
content/projects/leavenotice.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
|
||||
Title: LeaveNotice
|
||||
Author: Andrew Meyer
|
||||
Description: LeaveNotice is a jQuery plugin to easily notify your users when they leave your website.
|
||||
Date: 20110701
|
||||
|
||||
*/
|
||||
|
||||
**LeaveNotice** is a plug in to easily notify your users that they are leaving your website. This was developed with “official” type websites in mind (Government, money-processing, etc). Because of the nature of the information those sites house, it can be important to make sure users know that they are being linked to a site not under “official” jurisdiction.
|
||||
|
||||
[See Examples](http://www.rewdy.com/tools-files/leaveNotice/example.html) | [Download from Github](http://github.com/rewdy/leaveNotice)
|
85
content/projects/mapilicious.md
Normal file
85
content/projects/mapilicious.md
Normal file
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
|
||||
Title: Mapilicious
|
||||
Description: A jQuery plugin for automatically adding Google maps links to addresses.
|
||||
Date: 20130321
|
||||
Tags: Project, Maps, jQuery
|
||||
|
||||
*/
|
||||
|
||||
## Overview
|
||||
|
||||
This plugin was created out of necessity. One day I decided I was sick of going to Google Maps, entering an address, clicking the little link icon, and copying the URL for a link whenever I added an address to something. This plugin automates that process. It finds the address tags and appends a link to the address on Google maps.
|
||||
|
||||
[See examples](http://www.rewdy.com/tools-files/mapilicious/examples.html) | [Download from Github](https://github.com/rewdy/mapilicious)
|
||||
|
||||
**Note:** Consider this "beta" and kindly report any issues you find. Thanks. :)
|
||||
|
||||
## Implementation
|
||||
|
||||
It's as easy as 1-2-3
|
||||
|
||||
### 01. Include the Javascript
|
||||
|
||||
You will need to include the jQuery and jQuery Mapilicious right before the closing body tag (or in the head if you prefer). Link to them where ever you have them stored.
|
||||
|
||||
...
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script src="jquery.mapilicious.min.js"></script>
|
||||
</body>
|
||||
|
||||
### 02. Verify the Markup for Addresses in your Code
|
||||
|
||||
Mapilicious needs to know where the addresses in your code are. The semantic way to markup an address is to use the `<address>` tag. Ideally, you should wrap all your addresses in this tag. The default behavior for Mapilicious is to look for address tags and use them to insert the links.
|
||||
|
||||
If you are unable to format your addresses this way, however, you can select the addresses on your page with any other jQuery selector.
|
||||
|
||||
### 03. Fire up Mapilicious and enjoy
|
||||
|
||||
If you are using all the default behavior, all you need is the following code inserted after the scripts included in step 1. If you have markup for your addresses other than the standard address tag, just target your addresses with the jQuery selector like the second example.
|
||||
|
||||
<script>
|
||||
// standard method, looks for <address> tags.
|
||||
$().mapilicious();
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// alternative method, not using <address> tags.
|
||||
$('p.address').mapilicious();
|
||||
</script>
|
||||
|
||||
And, of course, the `p.address` would be replaced with whatever selector you are using.
|
||||
|
||||
Voila!
|
||||
|
||||
## Options Reference
|
||||
|
||||
Here's the fun part. The options. Options can be sent to Mapilicious in the standard jQuery way. Here's an example:
|
||||
|
||||
<script>
|
||||
$().mapilicious({
|
||||
placement: 'after',
|
||||
linkText: 'View a map'
|
||||
});
|
||||
</script>
|
||||
|
||||
<dl>
|
||||
<dt>range: <span class="default">'address'</span></dt>
|
||||
<dd>This sets where Mapilicious looks for addresses. This value gets set automatically (based on how Mapilicious is initiated) and doesn't ever really need to be used as an option.</dd>
|
||||
<dt>placement: <span class="default">'append'</span></dt>
|
||||
<dd><em>Options: 'append', 'prepend', 'after', 'before'</em><br />
|
||||
append - puts the link inside selector at the end<br />
|
||||
prepend - puts the link inside the selector at the beginning<br />
|
||||
after - puts it outside the selector after<br />
|
||||
before puts it outside the selector before</dd>
|
||||
<dt>mapUrl: <span class="default">'https://maps.google.com/maps?q='</span></dt>
|
||||
<dd>This is the base for the URL of the map link. Mapilicious is set to use Google maps by default, but if for some odd reason you want to use something else, you can enter the URL with this option. Note the <code>?q=</code> at the end of the URL. This is the query string for Google. Other services would probably use something slightly different.</dd>
|
||||
<dt>linkText: <span class="default">'Map'</span></dt>
|
||||
<dd>This is the text used for the map link. It can be set to something else if you prefer different verbiage.</dd>
|
||||
<dt>linkTemplate: <span class="default"><div class="mapilicious_map_link">{link}</div></span></dt>
|
||||
<dd>This is how the link is wrapped. The <code>{link}</code> will be replaced with the actual link. If you only want the link appended and no wrapping markup, this can be set to an empty string or <code>false</code>.</dd>
|
||||
<dt>linkAttr: <span class="default">''   —empty</span></dt>
|
||||
<dd>This option gives the ability to add a string to the map link. This can be used to add classes, a target, or other html attributes.</dd>
|
||||
</dl>
|
||||
|
||||
That's all folks. Issues? [Github it](https://github.com/rewdy/mapilicious/issues).
|
22
content/projects/pagination-plugin-pico.md
Normal file
22
content/projects/pagination-plugin-pico.md
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
|
||||
Title: Pagination Plugin for Pico
|
||||
Description: A plugin for Pico (the CMS) that add basic pagination.
|
||||
Date: 20130706
|
||||
Tags: Project, Pico
|
||||
|
||||
*/
|
||||
|
||||
**Pagination** for [Pico] is a plugin for the simple, lightweight CMS Pico (surprise!). It was created to add simple pagination to the system
|
||||
|
||||
[View on GitHub](https://github.com/rewdy/Pico-Pagination)
|
||||
|
||||
---
|
||||
|
||||
I recently discovered Pico. The Pico website describes it as, "A stupidly simple & blazing fast, flat file CMS." It's basically some glue to combine Markdown (for content) and Twig (for templating). It's quite nice and, I believe, lives up to it's tagline.
|
||||
|
||||
I played around with it this weekend and identified a few areas for improvement. One of them is pagination, which to my knowledge, it does not yet support. Using Pico's plugin architecture, I threw together simple pagination plugin, tested it a bit, and am releasing it now.
|
||||
|
||||
Try it out and let me know your thoughts. I'm sure there are bugs in it or room for improvement.
|
||||
|
||||
[Pico]:http://pico.dev7studios.com
|
36
plugins/main_menu.php
Normal file
36
plugins/main_menu.php
Normal file
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Main Menu plugin for Pico
|
||||
*
|
||||
* @author Andrew Meyer
|
||||
* @link http://rewdy.com
|
||||
* @license http://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
class Main_Menu {
|
||||
|
||||
public $menu_items = array();
|
||||
|
||||
public function get_pages(&$pages, &$current_page, &$prev_page, &$next_page)
|
||||
{
|
||||
|
||||
foreach($pages as $key=>$page) {
|
||||
if (!$page['date']) {
|
||||
$show_pages[$key] = $page;
|
||||
if ($page['url'] == $current_page['url']) {
|
||||
$show_pages[$key]['current'] = true;
|
||||
} else {
|
||||
$show_pages[$key]['current'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->menu_items = $show_pages;
|
||||
}
|
||||
|
||||
public function before_render(&$twig_vars, &$twig)
|
||||
{
|
||||
$twig_vars['menu_items'] = $this->menu_items;
|
||||
}
|
||||
}
|
1
plugins/pagination
Submodule
1
plugins/pagination
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 7b0235a4da1ebc78de133a631de2d292757900fd
|
1
themes/elliot
Submodule
1
themes/elliot
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit d83496e3d2ffb023354f8779b6a4fa597056e041
|
Loading…
Add table
Reference in a new issue