{"id":23893310,"url":"https://github.com/sumpygump/greengrape","last_synced_at":"2025-04-10T12:52:01.018Z","repository":{"id":5612199,"uuid":"6819630","full_name":"sumpygump/greengrape","owner":"sumpygump","description":"Simplified way of managing a website. No Database, No CMS, No Wysiwyg editor -- Just your text editor and Markdown.","archived":false,"fork":false,"pushed_at":"2023-04-23T15:05:32.000Z","size":492,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T11:38:26.807Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sumpygump.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-22T22:20:10.000Z","updated_at":"2023-01-14T16:57:39.000Z","dependencies_parsed_at":"2023-01-16T19:15:55.293Z","dependency_job_id":null,"html_url":"https://github.com/sumpygump/greengrape","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fgreengrape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fgreengrape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fgreengrape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumpygump%2Fgreengrape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumpygump","download_url":"https://codeload.github.com/sumpygump/greengrape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248220325,"owners_count":21067283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-04T14:17:40.939Z","updated_at":"2025-04-10T12:52:00.988Z","avatar_url":"https://github.com/sumpygump.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Greengrape\n==========\n\nGreengrape provides a simplified way to create a website without complex\nconfigurations. You simply create content in Markdown files in a structured\nset of folders and let the site produce the navigation and layout.\n\nA couple advantages with this approach as compared to traditional CMS packages\nare as follows:\n\n - No database requirement\n - No *admin panel* or complex configuration steps.\n - No *wysiwyg* editors or image upload dialogs.\n - You can just create content in folders and refresh the site to see the \n   changes. Ideally, you would have it in version control, commit the changes\n   and then run an update on the server.\n\nGreengrape is written for PHP 5.3.\n\n## Download\n\nYou can download Greengrape from Github at https://github.com/sumpygump/greengrape/\n\n### Download as archive\n\nIf you download as an archive, you can start making changes and commit into\nyour own version control.\n\n    $ wget https://github.com/sumpygump/greengrape/archive/master.tar.gz\n    $ tar xzf master.tar.gz\n\nThis will create a directory called `greengrape-master`\n\n### Clone repository\n\nYou can also clone the repository like so:\n\n    $ git clone git://github.com/sumpygump/greengrape.git\n\n## Installation\n\nOnce you have the files on your computer, you need to complete a few steps to\nget the site running.\n\n### Composer\n\nGreengrape uses a few third-party libraries. You must use [composer][] to fetch the\nneeded libraries.\n\nIf you haven't installed composer yet, you can download the composer.phar\nexecutable or use the installer:\n\n    $ curl -s https://getcomposer.org/installer | php\n\nNow you can complete the setup by running the following\n\n1. Install dependencies with composer\n\n        $ composer.phar install\n\n  This will use the `composer.json` file to install the [Twig][] and [Markdown][]\n  libraries.\n\n2. Copy `config.ini-dist` to `config.ini`\n\n        $ cp config.ini-dist config.ini\n\n3. Copy `.htaccess-dist` to `.htaccess` and edit RewriteBase\n\n        $ cp .htaccess-dist .htaccess\n        $ vi .htaccess\n\n   You need to edit line 8 in that file. Change it to include the Base URL of\n   where you have placed the files. For example, if you put the\n   `greengrape-master` directory in `/var/www/testing/greengrape-master` folder in you apache\n   webroot, (and assuming `/var/www` is the webroot) you will need to edit the line to read:\n\n        RewriteBase /testing/greengrape-master/\n\n   If you installed this on a server where the greengrape directory is at the\n   root, then it should read\n\n        RewriteBase /\n\n4. Make the `cache` directory world writable\n\n        $ chmod a+w cache -R\n\n   You could also update this directory to be owned by your apache user (like\n   www-data), but I'll let you decide.\n\n5. Load the site up in your browser and you should see the welcome page.\n\n[composer]: http://getcomposer.org/\n[twig]: https://github.com/fabpot/Twig\n[Markdown]: https://github.com/dflydev/dflydev-markdown\n\n## Usage\n\n### The Content\n\nAll of your content resides in the `content` folder. By default you can see\nthere is an `index.md` file there. That file contains the Markdown for the the\nhome page.\n\nYou can add more `.md` (Markdown) files in this directory and they will be available in your\nbrowser at a URL sans the `.md` extension. For example, if I created a file\ncalled `hello.md` it would be available at *mysite.com/hello*.\n\nYou can add folders in the content folder and these will be treated as top\nlevel navigation. I could add a new `projects` directory and some files in that\nfolder, like so:\n\n    content\n    ├── index.md\n    └── projects\n        ├── funstuff.md\n        └── index.md\n\nThe contents of `projects/index.md` would be served up if I accessed the URL\n*mysite.com/projects/* and the `funstuff.md` file would be available at\n*mysite.com/projects/funstuff*\n\n### Navigation Reflects the Folder Structure\n\nNow when I refresh the home page, I see a top level navigation at the top\nshowing `Home` and `Projects`. Greengrape automatically adds this in based on\nthe folders in the root of the `content` folder. It will also generate a\nsub-navigation at the second level from the root of `content`. It only\ngenerates navigation automatically as far as that second level, but you can\nmake folders as deeply nested as you like.\n\n### Sorting and Hiding Navigation Items\n\nThe items appear in the navigation according to alphabetical order. You can\nalter the order by prepending the folder names with a number and a dot, (e.g.\n`01.projects`), the `01.` will be stripped and so the URLs will display as\n*mysite.com/projects*.\n\nIf you don't want a folder to appear in the navigation list, prepend the folder\nname with an underscore (`_`).\n\nYou can add all kinds of content using the easily readable Markdown syntax by\njust editing folders and files on your computer with the text editor of your\nchoice. That is the beauty of Greengrape.\n\nFor a complete reference of the syntax of Markdown please see [the\nMarkdown documentation](http://daringfireball.net/projects/markdown/syntax/).\n\n### Assets\n\nTo add images to your Markdown files, you can add them to the `assets`\ndirectory; `assets/img` is a good place for images. In your Markdown files you\ncan reference them using the following examples:\n\n    See this image: ![alt text](assets/img/coolimage.png).\n\nor\n\n    See this image: ![alt text][id]\n    ...\n    [id]: assets/img/coolimage.png \"Optional title attribute\"\n\nYou can also reference images from another domain too, just include `http://`.\nFor more information about Markdown syntax for images, see the documentation\nfor [images in Markdown](http://daringfireball.net/projects/markdown/syntax/#img).\n\nGreengrape will automatically put the correct BaseUrl on the path to the image,\nso if the install location of the site changes, your references will stay in\ntact.\n\n### Links\n\nLinks work the same way in Greengrape as with images. It will include the\nBaseUrl of wherever Greengrape is installed to ensure the links stay correct if\nthe install directory ever changed. Just make the reference as if at the root\nof the greengrape folder like so (this is using our earlier example of the\n`project/funstuff.md` path):\n\n    Check out the [fun stuff](projects/funstuff) I did.\n\nYou can of course add links to other domains as well. Don't forget to include\nthe `http://`:\n\n    Link to [google](http://google.com/).\n\n## Themes\n\nThe `themes` folder is where the layout and styles and javascript reside for\nyour site. Currently, the only theme is the default theme called, \"fulcrum.\"\nGreengrape is setup in a way that you could create a new theme and even switch\nthemes while not disturbing your content, which lives separately in the\n`content` folder.\n\nThere is no advanced documentation on making a theme, but to begin, I would\nsuggest making a copy of the fulcrum theme and editing the files.\n\nThe theme files use Twig as the templating engine.\n\nThe key files of a theme are the following:\n\n - `layout.html` - This is the basic layout of the theme and all pages will use\n   this as the boilerplate for serving the base HTML tags.\n\n - `templates/default.html` - The templates folder contains snippets of HTML that\n   can be used by content block. Currently it is not possible to assign\n   different templates to content files (the `.md` files) but it will be a\n   future enhancement to assign a content file to use a specific template file.\n   Currently all content files use the default template.\n\n - `templates/error.html`, `templates/404.html`, `templates/_navigation.html`,\n   `templates/_subnavigation.html` - These files are all used internally by\n   Greengrape to serve error messages, 404 pages and the navigation. Since it\n   is HTML with Twig templating, it is useful to know you can make\n   modifications to the output to modify a theme.\n\n - `css`, `img`, `js` - These folders contain CSS, images and JavaScript files.\n   These files can be referenced in the layout.html and templates using the\n   following Twig syntax:\n\n        \u003clink rel=\"stylesheet\" href=\"{{ asset.file('css/bootstrap.min.css') }}\" /\u003e\n        \u003cimg class=\"pull-left\" src=\"{{ asset.file('img/greengrape.jpg') }}\"\n        \u003cscript type=\"text/javascript\" src=\"{{ asset.file('js/plugins') }}\"\u003e\u003c/script\u003e\n\n   Note that if you leave the extension of the filename, Greengrape will\n   automatically append a `.js` or `.css` depending on the folder being\n   referenced.\n\n   You can also add other assets to a theme and reference them in the same way,\n   using the `asset.file()` syntax.\n\n## Config file\n\nThe config file is a simple `.ini` file to provide some settings to Greengrape.\nThe example file is similar to the following:\n\n    ; Site name\n    sitename = \"My awesome site\"\n\n    ; Theme to use\n    theme = \"fulcrum\"\n\n    ; Whether cache is enabled\n    enable_cache = false\n\n    ; Additional view params\n    author = \"Doc Brown\"\n    description = \"A sample website built with Greengrape\"\n\nThe most important things about this file are the `sitename`, `theme` and\n`enable_cache` settings.\n\n - `sitename` provides the default title for the site\n - `theme` tells Greengrape with theme to use in the `themes` folder\n - `enable_cache` will enable or disable the cache\n\nYou can add other param here and they will be passed into the layout file of\nthe theme using Twig's `{{ }}` syntax, for example:\n\n    \u003cmeta name=\"author\" content=\"{{ layout.author }}\"\u003e\n\nAdditional params would be useful for include Google Analytics account numbers\nthat need to be output with the HTML layout, for example.\n\n## Cache\n\nGreengrape's cache will serve up a cached file that represents any content file\nthat is accessible if the corresponding file exists in the cache, otherwise it\nwill generate the HTML output and save it to the cache.\n\nThere is not a robust way to clear the cache in this version, but it is\npossible to clear the cache by deleting the files in the `cache/content`\nfolder. A more advanced cache clearing system will be developed in future\nversions.\n\nIt is also possible to clear the cache by appending the query string parameter\n`?cache=clear` to a request. This will clear the cache for the given requested\npage.\n\nIt is suggested for ease of development to adjust the setting in the\nconfig.ini file to disable the cache while the site's content is under\ndevelopment and then enabling it when it is relatively stable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumpygump%2Fgreengrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumpygump%2Fgreengrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumpygump%2Fgreengrape/lists"}