Skip to content

Commit

Permalink
Inject SEO verification
Browse files Browse the repository at this point in the history
  • Loading branch information
ciukstar committed Jan 29, 2024
1 parent a82ac24 commit f4f7f03
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 15 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ ARG YESOD_DEMO_LANG=EN
ARG YESOD_MAPBOX_PK
ARG YESOD_STRIPE_PK
ARG YESOD_STRIPE_SK
ARG YESOD_GOOGLE_SITE_VERIFICATION
ARG YESOD_GOOGLE_CLIENT_ID
ARG YESOD_GOOGLE_CLIENT_SECRET
ARG YESOD_YANDEX_VERIFICATION

WORKDIR /opt/salon
COPY salon /opt/salon
Expand All @@ -23,8 +25,10 @@ ENV YESOD_DEMO_LANG=${YESOD_DEMO_LANG}
ENV YESOD_MAPBOX_PK=${YESOD_MAPBOX_PK}
ENV YESOD_STRIPE_PK=${YESOD_STRIPE_PK}
ENV YESOD_STRIPE_SK=${YESOD_STRIPE_SK}
ENV YESOD_GOOGLE_SITE_VERIFICATION=${YESOD_GOOGLE_SITE_VERIFICATION}
ENV YESOD_GOOGLE_CLIENT_ID=${YESOD_GOOGLE_CLIENT_ID}
ENV YESOD_GOOGLE_CLIENT_SECRET=${YESOD_GOOGLE_CLIENT_SECRET}
ENV YESOD_YANDEX_VERIFICATION=${YESOD_YANDEX_VERIFICATION}

EXPOSE 8080
CMD ["./salon"]
10 changes: 10 additions & 0 deletions README.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ De plus, la facture peut être téléchargée au format PDF ou HTML et envoyée
ENV: YESOD_GOOGLE_CLIENT_ID, YESOD_GOOGLE_CLIENT_SECRET
```

## Optimisation du moteur de recherche

* [Google SEO](https://search.google.com/search-console)

```$YESOD_GOOGLE_SITE_VERIFICATION```

* [Yandex SEO](https://webmaster.yandex.com/welcome)

```$YESOD_YANDEX_VERIFICATION```


## Diagramme ERD

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ Additionally, the invoice can be downloaded in PDF or HTML format and sent to th
ENV: YESOD_GOOGLE_CLIENT_ID, YESOD_GOOGLE_CLIENT_SECRET
```

## Search Engine Optimization

* [Google SEO](https://search.google.com/search-console)

```$YESOD_GOOGLE_SITE_VERIFICATION```

* [Yandex SEO](https://webmaster.yandex.com/welcome)

```$YESOD_YANDEX_VERIFICATION```

## ERD Diagram

![Entity Relationship Diagram](static/img/Salon-ERD.svg)
Expand Down
10 changes: 10 additions & 0 deletions README.ro.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ După crearea unei noi facturi și adăugarea elementelor acesteia, factura poat
ENV: YESOD_GOOGLE_CLIENT_ID, YESOD_GOOGLE_CLIENT_SECRET
```

## Optimizare motor de căutare

* [Google SEO](https://search.google.com/search-console)

```$YESOD_GOOGLE_SITE_VERIFICATION```

* [Yandex SEO](https://webmaster.yandex.com/welcome)

```$YESOD_YANDEX_VERIFICATION```


## Diagrama ERD

Expand Down
10 changes: 10 additions & 0 deletions README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@
ENV: YESOD_GOOGLE_CLIENT_ID, YESOD_GOOGLE_CLIENT_SECRET
```

## Поисковая оптимизация

* [Яндекс Вебмастер](https://webmaster.yandex.ru/welcome)

```$YESOD_YANDEX_VERIFICATION```

* [Google SEO](https://search.google.com/search-console)

```$YESOD_GOOGLE_SITE_VERIFICATION```

## ER-диаграмма

![Диаграмма отношений сущностей](static/img/Salon-ERD.svg)
Expand Down
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ idle-timeout: "_env:YESOD_SQLITE_IDLETIMEOUT:1200"
mapbox-pk: "_env:YESOD_MAPBOX_PK:pk.xxx"
stripe-pk: "_env:YESOD_STRIPE_PK:pk.yyy"
stripe-sk: "_env:YESOD_STRIPE_SK:sk.zzz"
google-site-verification: "_env:YESOD_GOOGLE_SITE_VERIFICATION"
google-client-id: "_env:YESOD_GOOGLE_CLIENT_ID:xxx"
google-client-secret: "_env:YESOD_GOOGLE_CLIENT_SECRET:xxx"
yandex-verification: "_env:YESOD_YANDEX_VERIFICATION"

copyright: Insert copyright statement here
#analytics: UA-YOURCODE
1 change: 1 addition & 0 deletions messages/en.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SearchEngineOptimization: Search Engine Optimization
SignInWithGoogle: Sign in with Google
Cleared: Cleared
InvalidStoreType: Invalid store type
Expand Down
1 change: 1 addition & 0 deletions messages/fr.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SearchEngineOptimization: Optimisation du moteur de recherche
SignInWithGoogle: Connectez-vous avec Google
Cleared: Effacé
InvalidStoreType: Type de stockage invalide
Expand Down
1 change: 1 addition & 0 deletions messages/ro.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SearchEngineOptimization: Optimizare motor de căutare
SignInWithGoogle: Conectați-vă cu Google
Cleared: S-a șters
InvalidStoreType: Tip de stocare nevalid
Expand Down
1 change: 1 addition & 0 deletions messages/ru.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SearchEngineOptimization: Поисковая оптимизация
SignInWithGoogle: Войти через Google
Cleared: Очищено
InvalidStoreType: Неверный тип хранилища
Expand Down
3 changes: 2 additions & 1 deletion src/Handler/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Foundation
( Handler
, Route
( HomeR, ServicesR, BookOffersR, BookingsCalendarR, AboutUsR
, ContactR, ResourcesR, StaticR
, ContactR, ResourcesR, StaticR, FaviconR
)
, ResourcesR (DocsR), AppMessage (MsgAppName, MsgMetaDescription)
)
Expand Down Expand Up @@ -67,6 +67,7 @@ getWebAppManifestR = do

getSitemapR :: Handler TypedContent
getSitemapR = sitemap $ do
yield $ SitemapUrl FaviconR Nothing (Just Monthly) (Just 0.5)
yield $ SitemapUrl (ResourcesR DocsR) Nothing (Just Monthly) (Just 1.0)
yield $ SitemapUrl HomeR Nothing (Just Monthly) (Just 1.0)
yield $ SitemapUrl ServicesR Nothing (Just Monthly) (Just 0.9)
Expand Down
2 changes: 1 addition & 1 deletion src/Handler/Resources.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Foundation
, MsgErdDiagram, MsgBookingStateDiagram, MsgAppointmentStateDiagram
, MsgBasicEntities, MsgBusiness, MsgUser, MsgPaymentGateway, MsgOnlineMaps
, MsgAppName, MsgOverview, MsgStaff, MsgService, MsgOffer, MsgInvoice
, MsgEmail
, MsgEmail, MsgSearchEngineOptimization
, MsgDoc001, MsgDoc002, MsgDoc003, MsgDoc004, MsgDoc005, MsgDoc0061
, MsgDoc0062, MsgDoc0063, MsgDoc0064, MsgDoc0065, MsgDoc0066, MsgDoc0067
, MsgDoc0068, MsgDoc007, MsgDoc008, MsgDoc009, MsgDoc010, MsgDoc011
Expand Down
16 changes: 10 additions & 6 deletions src/Settings.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ data AppSettings = AppSettings

, appAuthDummyLogin :: Bool
-- ^ Indicate if auth dummy login should be enabled.
, appMapboxPk :: Text
, appStripePk :: Text
, appStripeSk :: Text
, appGoogleClientId :: Text
, appGoogleClientSecret :: Text
, appMapboxPk :: Text
, appStripePk :: Text
, appStripeSk :: Text
, appGoogleSiteVerification :: Maybe Text
, appGoogleClientId :: Text
, appGoogleClientSecret :: Text
, appYandexVerification :: Maybe Text
}

instance FromJSON AppSettings where
Expand Down Expand Up @@ -97,13 +99,15 @@ instance FromJSON AppSettings where
appCopyright <- o .: "copyright"
appAnalytics <- o .:? "analytics"

appAuthDummyLogin <- o .:? "auth-dummy-login" .!= dev
appAuthDummyLogin <- o .:? "auth-dummy-login" .!= dev

appMapboxPk <- o .: "mapbox-pk"
appStripePk <- o .: "stripe-pk"
appStripeSk <- o .: "stripe-sk"
appGoogleSiteVerification <- o .: "google-site-verification"
appGoogleClientId <- o .: "google-client-id"
appGoogleClientSecret <- o .: "google-client-secret"
appYandexVerification <- o .: "yandex-verification"


return AppSettings {..}
Expand Down
2 changes: 1 addition & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# resolver: ./custom-snapshot.yaml
# resolver: https://example.com/snapshots/2018-01-01.yaml
resolver:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/6.yaml
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/7.yaml

# User packages to be built.
# Various formats can be used as shown in the example below.
Expand Down
8 changes: 4 additions & 4 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ packages:
hackage: stripe-haskell-2.6.2@sha256:4ad015702e65b3219b9f2db10b8ae35873254a149f7b735c5d3e6250d7b641a1,1130
snapshots:
- completed:
sha256: 1b4c2669e26fa828451830ed4725e4d406acc25a1fa24fcc039465dd13d7a575
size: 714100
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/6.yaml
sha256: 7b975b104cb3dbf0c297dfd01f936a4d2ee523241dd0b1ae960522b833fe3027
size: 714096
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/7.yaml
original:
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/6.yaml
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/7.yaml
6 changes: 4 additions & 2 deletions templates/default-layout-wrapper.hamlet
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ $doctype 5
<meta name="author" content="Sergiu Starciuc, [email protected]">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#FEDBD0">
<meta name="google-site-verification" content="a5AUtJixuZ1_hbHg7AbmclYAYk5AkZylPeIFRsesEXI">
<meta name="yandex-verification" content="92c10516dea08e0b" />
$maybe gsv <- appGoogleSiteVerification $ appSettings master
<meta name="google-site-verification" content=#{gsv}>
$maybe yv <- appYandexVerification $ appSettings master
<meta name="yandex-verification" content=#{yv}>

<link rel="manifest" href=@{WebAppManifestR}>

Expand Down
13 changes: 13 additions & 0 deletions templates/resources/docs.hamlet
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,19 @@
<small>
<code>ENV: YESOD_GOOGLE_CLIENT_ID, YESOD_GOOGLE_CLIENT_SECRET

<div.mdc-typography--headline4>_{MsgSearchEngineOptimization}
<ul>
<li>
<a href="https://search.google.com/search-console" target=_blank>Google SEO
<p>
<small>
<code>&dollar;YESOD_GOOGLE_SITE_VERIFICATION
<li>
<a href="https://webmaster.yandex.com/welcome" target=_blank>Yandex SEO
<p>
<small>
<code>&dollar;YESOD_YANDEX_VERIFICATION

<div.mdc-typography--headline4>
_{MsgErdDiagram}
<img #imgErdDiagram src=@{StaticR img_Salon_ERD_svg} alt=_{MsgErdDiagram} loading=lazy>
Expand Down

0 comments on commit f4f7f03

Please sign in to comment.