-
Notifications
You must be signed in to change notification settings - Fork 4
Home
This application uses Wordpress as a CMS.
Project was set up using Trellis: https://roots.io
Documentation of Trellis is pretty straight-forward. If you have questions open an issue and label it question
please.
- This guide assumes you are using a unix-like based OS and you install the project in a folder called
fiipregatit.ro
- Some parts described below can be automated via Vagrant provisioning (post-up)
- The development environment is configured to show notices. WordPress core being what it is, you might see some E_NOTICE messages pop up in the admin panel - this is expected sigh
- Some things are subject to change as the project progresses, if you spot any inconsistencies please either open an issue labeled
question
, either send a pull request
- virtualbox (or another vagrant provider): https://www.vagrantup.com/docs/providers/
- Ansible 2.3.0: http://docs.ansible.com/ansible/latest/intro_installation.html
$> git clone https://github.com/civictechro/fiipregatit.ro
$> cd fiipregatit.ro/trellis/group_vars/development/
$> cp sample.vault.yml vault.yml
$> vim vault.yml # feel free to change the default admin password
$> cd ../../../../ # go back to the trellis directory
$> vagrant up
Now you should be able to access the dev environment in the browser at http://dev.fiipregatit.ro
. You'll be welcomed by a default Wordpress installation, so we need to config the environment.
Open http://dev.fiipregatit.ro/admin
. Use the admin password you just set in vault.yml
to login, with the username admin
.
Once logged in, it's time to config a few things in the admin panel:
- Go to
Appearance->Themes
and enable fiipregătit.ro, our custom theme - Go to
Custom Fields->Tools
, and uploadfiipregatit.ro/site/config/misc/acf-export-yyyy-mm-dd.json
using theImport Field Groups
panel. - The navigation is not enabled by default. To add the main navigation go to
Appearance->Customize->Menus->Main Navigation
and create the menu. Make sure you check theMain Navigation
menu location here. Publish when you're done. - Lastly, it's time to import some scaffolding data. Navigate to
Tools->Import
and selectRun Importer
for the WordPress option (last one). Now importfiipregatit.ro/site/config/misc/fiipregtitro.wordpress.yyyy-mm-dd.xml
Unless you're debugging - always import the most recent timestamps.
- The
Export/Import
flow for the data scaffolding is less than ideal since it doesn't take into account the media library so the guides and campaigns are broken and will not display properly. See issue #46 - The import flow will throw a lot of E_NOTICEs sigh
- Some of the steps described here could probably be automated: issue #48
You will need Node.js
>= 4.5.0 and the latest version of npm
. Additionally, you will need gulp
and bower
.
$> cd fiipregatit.ro/site/web/app/themes/sage
$> npm install
$> bower install
$> gulp watch // to compile assets and live reload on changes
- To edit templates:
fiipregatit.ro/site/web/app/themes/sage/templates
- To edit CSS/JS:
fiipregatit.ro/site/web/app/themes/sage/assests/
- Documentation: https://roots.io/sage/docs/theme-development-and-building/
Please note {development,production,staging}/vault.yml
are added to .gitignore
.
To add your credentials simply copy the sample.vault.yml
to vault.yml
and change your credentials accordingly.
Please change the sample.vault.yml files if you make changes to vault configurations.
We use Algolia for search. If you're not actively working on search, there's no need for you to read further. If you are:
- You need to create an account on Algolia. They offer a free plan, that should be more than enough for development purposes.
- Go to
Algolia->Settings
: Add the API keys from your Algolia app dashboard. - Go to
Algolia->Autocomplete
: CheckEnable autocomplete
, then checkGhiduri
andCampanii
and hitSave changes
. Make sure you re-index bothGhiduri
andCampanii
. - Go to
Algolia->Search Page
: CheckUse Algolia with Instantsearch.js
.Save changes
and hitRe-index search page records
.
Now that you're set, here's the code:
-
sage/algolia/
contains the templates for the autocomplete dropdown (autocomplete.php
) and the search results page (instantsearch.php
) -
sage/lib/Algolia/
contains the code used for indexing our custom post types
There are also settings in the Algolia dashboard that you can set, but they are mostly for determining which results are more relevant. You will probably have to go to each index, the display
tab, and add preview_text
to the Attributes to snippet
property. This is the text we display below each search result.
Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (57)
Fix:
- If using node v8.0, bump it down (v6.0 should be fine) - https://github.com/jakearchibald/wittr/issues/20#issuecomment-342469349
-
npm rebuild node-sass
if the above fails - https://github.com/sass/node-sass/issues/1764\
Frontend work: https://roots.io/sage/docs/theme-development-and-building/ Backend work: https://roots.io/trellis/docs/local-development-setup/