ritstudentgovernment / petitions

PawPrints petition application for the RIT community.
https://pawprints.rit.edu
MIT License
35 stars 13 forks source link

Allow configurable seo #100

Closed ceko closed 8 years ago

ceko commented 8 years ago

Another small but very useful change. I made a new setting: Meteor.settings.public.seo_overrides. This lets you override the title and description of pages within your settings file. I use it like this:

{
  "LDAP": {
   ...
  },
  "MAIL": {
   ...
  },  
  "public": {    
    "seo_overrides": {        
      "petitionSubmit": {
        "title": "Submit Petition",
        "description": "Submit a petition to GoldenWings."
      },
      "petitionsInProgress": {
        "title": "Recognized Petitions",
        "description": "View petitions being actively worked on."
      },
      "petitionsList": {
        "title": "Petitions",
        "description": "GoldenWings is a place for sparking change at Naz. Share ideas with the Naz community and influence decision making."
      },
      "petitionsResponses": {
        "title": "Petition Responses",
        "description": "View petitions that have received responses."
      },
      "petitionsTagList": {
        "title": "Tagged Petitions",
        "description": "View tagged petitions on GoldenWings."
      },
      "petitionPage": {
        "title": "View Petition",
        "description": "View petition on GoldenWings."
      },      
      "about": {
        "title": "About GoldenWings",
        "description": "Learn more about the history of GoldenWings, its goal and vision."
      },      
      "api": {
        "title": "API Access",
        "description": "GoldenWings provides a read-only JSON REST API for retreiving petition information."
      },
      "moderation": {
        "title": "Moderation Policy",
        "description": "GoldenWings follows the Naz Code of Conduct for Computer and Network Use."
      },      
      "index": {
        "title": "GoldenWings",
        "description": "GoldenWings is a place for sparking change at Naz. Share ideas with the Naz community and influence decision making."
      }
    }    
  }
}

I also changed the name of the seo.js file to main.seo.js, so it loads after all the other lib files (like the lodash _.get underscore mixin) so I can use library functions in it.

The last change is changing PawPrints to Petitions in main.html. It gets overridden in the main.seo.js file anyway, but if it doesn't, it will cause less confusion for clients of people like me who are forking the project. I couldn't figure out how to change that text dynamically, since it's not in a template.

NathanCastle commented 8 years ago

Looks great!