Using variables in Lovelace

I have 25 lights that I’m adding to a picture-elements card.

            # OFFICE LIGHT #
            - type: state-icon
              entity: light.office
              style:
                top: 41.5%
                left: 70%
                transform: "scale(1.5)"
              tap_action:
                action: toggle
              hold_action:
                action: call-service
                service: browser_mod.popup
                service_data:
                  title: Office Light
                  larger: true
                  style:
                    width: 100%
                    height: 100%
                  card:
                    type: custom:light-popup-card
                    entity: light.office
                    icon: mdi:lightbulb
                    actionsInARow: 2
                    supportedFeaturesTreshold: -1
                    brightnessWidth: 130px
                    brightnessHeight: 380px
                    borderRadius: 35px
                    sliderColor: "#FFD60A"
                    sliderTrackColor: "#2c2c2e"
                    sliderThumbColor: "#2c2c2e"
              DeviceID:
                - this

Everything from the tap_action line and below will be identical, except the entity and title.

Is it possible to use something like !include popup.yaml and then define variables for entity and title?

Have a look at lovelace_gen:

YAML anchors may also be helpful here, or the decluttering card.