Unverified Commit ddc5bc1b authored by Aral Balkan's avatar Aral Balkan
Browse files

Fixes #40: template placeholders on published site pages updated properly

This was a regression introduced during the spotlight → sites refactoring.
parent 177b84dc
......@@ -117,18 +117,18 @@ class ParsedHAR
Statistics.generateIfNecessary().then (globalStatistics) =>
statistics = @statistics()
filePathForPublishedSpotlightEntry = path.join path.homedir(), 'better.fyi', 'content', 'spotlight', statistics.domain, 'index.md'
filePathForPublishedSitesEntry= path.join path.homedir(), 'better.fyi', 'content', 'sites', statistics.domain, 'index.md'
# console.log "filePathForPublishedSpotlightEntry = #{filePathForPublishedSpotlightEntry}"
# console.log "filePathForPublishedSitesEntry= #{filePathForPublishedSitesEntry}"
# console.log @thirdPartyRequests.uniqueDomains.set
templateRenderFunctions = [
# Spotlight draft
# Site draft
=> Template.renderSiteTemplateWithData statistics, true
# Spotlight in published content (note: might not exist. That’s fine, we’ll update it if it does, ignore the failure if not.)
=> Template.renderTemplateAtFilePath filePathForPublishedSpotlightEntry, statistics, true
# Site in published content (note: might not exist. That’s fine, we’ll update it if it does, ignore the failure if not.)
=> Template.renderTemplateAtFilePath filePathForPublishedSitesEntry, statistics, true
]
# Add one entry per tracker we want to update to the template render functions.
......@@ -468,7 +468,7 @@ class ParsedHAR
hostname: @hostname()
lastUpdate: (moment @date).format('dddd, MMMM Do YYYY')
trackersList: " * Trackers\n#{@thirdPartyRequests.uniqueDomains.toMarkdown()}"[...-1]
trackersList: " * (Trackers)\n#{@thirdPartyRequests.uniqueDomains.toMarkdown()}"[...-1]
uniqueTrackersBlocked: @thirdPartyRequestsThatAreCurrentlyBlocked.uniqueDomains.count()
uniqueTrackersThatCanBeBlocked: @thirdPartyRequestsThatCanBeBlocked.uniqueDomains.count()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment